/*
 * @Author: your name
 * @Date: 2021-03-30 12:52:54
 * @LastEditTime: 2021-04-01 13:30:09
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \my-app-koa\validation\register.js
 */
const Validator = require('validator');
const isEmpty = require("./is-empty.js")
module.exports = function validateExperienceInput (data) {
  let errors = {};
  if (Validator.isEmpty(data.title)) {
    errors.password = "标题不能为空"
  }
  if (Validator.isEmpty(data.company)) {
    errors.email = "公司不能为空"
  }
  if (Validator.isEmpty(data.from)) {
    errors.email = "起始时间不合法"
  }

  return {
    errors,
    isValid: isEmpty(errors)
  }
}
